package java_methods;

public class PassingByValue {
	
	public static void foo(Dog d) {
	    //d = new Dog("Acer");
		d.name = "Alpha";
	}
	
	public static void test(int x){
		x++;
	}
	
	public static void main(String[] args) {
		Dog aDog = new Dog("Ajax");
		// at this point, aDog points to the "Ajax" dog
		foo(aDog);
		// aDog points to the "Alpha" dog
		System.out.println(aDog.name);
		
		int x = 10;
		test(x);
		System.out.println(x);
		// What value of x will be printed
	}
}
